<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>产品列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <s:debug></s:debug> 
    <table>
    	<thead>
    	<tr><td>名称</td><td>备注</td><td>id</td></tr>
    	</thead>
    	<s:iterator value="qr.resultlist" var="product">
    	<tr>
    		<td>${product.name}</td>
    		<td><img src="<s:url value='%{#product.name}'></s:url>" title="品牌图片"/></td>
    		<td><s:a namespace="/product" action ="modifyUI" includeParams="all"><s:param name="br.code" value="#product.name"></s:param>修改</s:a> </td>
    	</tr>
    	</s:iterator>
    	<tr>
    	
    	<td><input type="button" value="添加产品" onclick="javasrcipt:window.location.href='<s:url value="/product/addUI"/>'" ></input></td></tr>
    	
    	</table>
    	<table>
    	<tr><td>当前第${pager.currPage}页/总共${pager.totalPage }页</td>
    	<s:if test="pager.currPage>1"><td><a href="product/list?pager.currPage=1">首页</a></td>
    	<td><a href="product/list?pager.currPage=${pager.lastPage }">上一页</a></td></s:if>
    	<s:if test="pager.currPage<pager.totalPage"><td><a href="product/list?pager.currPage=${pager.nextPage }">下一页</a></td>
    	<td colspan="2"><a href="product/list?pager.currPage=${pager.totalPage }">末页</a></td></s:if></tr>
    	</table>
  </body>
</html>
